Object.defineProperty(exports, "__esModule", {
  value: !0
}), Object.defineProperty(exports, "alert", {
  enumerable: !0,
  get: function () {
    return n.alert
  }
}), Object.defineProperty(exports, "confirm", {
  enumerable: !0,
  get: function () {
    return n.confirm
  }
}), exports.getCommonSystemInfo = void 0, exports.getCurrentPage = function () {
  var e = getCurrentPages();
  return e[e.length - 1]
}, exports.isIos = exports.getSystemInfoSync = exports.getMenuButtonBoundingClientRect = exports.getIndex = void 0, Object.defineProperty(exports, "jxAlert", {
  enumerable: !0,
  get: function () {
    return n.jxAlert
  }
}), exports.msg = function (e) {
  var t = arguments.length > 1 && void 0 !== arguments[1] ? arguments[1] : 2e3;
  return new Promise((function (n) {
    wx.showToast({
      title: e,
      icon: "none",
      duration: t
    }), setTimeout((function () {
      n(!0)
    }), t)
  }))
}, Object.defineProperty(exports, "router", {
  enumerable: !0,
  get: function () {
    return r.router
  }
}), exports.selectComponent = function (e) {
  return s.apply(this, arguments)
}, exports.showModal = function (e, t) {
  return new Promise((function (n) {
    wx.showModal({
      title: e,
      content: t,
      success: function (e) {
        n(!0)
      }
    })
  }))
}, exports.wait = function () {
  var e = arguments.length > 0 && void 0 !== arguments[0] ? arguments[0] : 1e3;
  return new Promise((function (t) {
    setTimeout(t, e)
  }))
};
var e = require("../../@babel/runtime/helpers/regeneratorRuntime"),
  t = require("../../@babel/runtime/helpers/asyncToGenerator"),
  n = require("../../components/base/custom-modal/core"),
  r = require("./router");
var o, u = function () {
  return o && o.top && o.height || (o = wx.getMenuButtonBoundingClientRect()), o
};
exports.getMenuButtonBoundingClientRect = u;
var i = function () {
  var e;
  return function () {
    return e || (e = wx.getSystemInfoSync())
  }
}();
exports.getSystemInfoSync = i;

function s() {
  return (s = t(e().mark((function t(n) {
    var r = this;
    return e().wrap((function (e) {
      for (;;) switch (e.prev = e.next) {
        case 0:
          return e.abrupt("return", new Promise((function (e, t) {
            var o = r.selectComponent(n);
            o ? e(o) : t()
          })));
        case 1:
        case "end":
          return e.stop()
      }
    }), t)
  })))).apply(this, arguments)
}
exports.getCommonSystemInfo = function () {
  var e = $.getMenuButtonBoundingClientRect(),
    t = $.getSystemInfoSync(),
    n = e.top - t.statusBarHeight,
    r = e.height + 2 * n;
  return {
    headerTop: r + t.statusBarHeight,
    headerHeight: r,
    menuPadding: n,
    statusBarHeight: t.statusBarHeight
  }
};
var a = function () {
  var e = 0;
  return function () {
    return e += 1, Math.random().toString(36).slice(2) + e
  }
}();
exports.getIndex = a;
var c = function () {
  var e = wx.getSystemInfoSync(),
    t = e.platform,
    n = e.system;
  return "ios" === t || "devtools" === t && /ios/i.test(n)
}();
exports.isIos = c;